<template>
<view>
<view class="head_box">
  <view class="head_img">
    <image mode="aspectFill" :src="userInfo.head_image"></image>
  </view>
  <view class="head_word">
    <view class="name">{{userInfo.nickname}}</view>
    <view class="time">会员到期时间：{{userInfo.end_viptime}}</view>
  </view>
</view>
<view class="clear"></view>
<view class="info_box">会员类别：{{userInfo.vip_level=='1'?'普通会员':'高级会员'}}</view>
<view class="info_box">姓名：{{userInfo.name}}</view>
<view class="info_box">联系电话：{{userInfo.phone}}</view>
<view class="info_box">地址：{{userInfo.address}}</view>
<view class="qy_info">会员权益：高级会员可以一次发布50条卖车信息</view>
<button class="know_butt" @tap="back_center">知道了</button>
</view>
</template>

<script>
var app = getApp();

export default {
  data() {
    return {
      userInfo: ''
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    that.firstin();
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    firstin: function () {
      var a = this;
      app.globalData.util.getUserInfo(function (e) {
        app.globalData.util.request({
          url: "entry/wxapp/Api",
          data: {
            m: "monai_market",
            r: "me.detail",
            uid: e.memberInfo.uid,
            head_image: e.memberInfo.avatar,
            nickname: e.memberInfo.nickname
          },
          success: function (e) {
            console.log(e), a.setData({
              userInfo: e.data.data.user
            });
          }
        });
      });
    },
    back_center: function () {
      wx.navigateTo({
        url: '../mine/index'
      });
    }
  }
};
</script>
<style>
@import "./asMember.css";
</style>